define(function(require) {
	
	var $ = require("jquery");
	var Validator = require("validator");
	
	var validator = new Validator({
        element: $("#user_register_form")
    }).addItem({
        element: '[name=username]',
        required: true,
        rule : 'minlength{"min":6} maxlength{"max":18}'
    }).addItem({
    	 element: '[name=password]',
        required: true,
        rule: 'minlength{"min":6} maxlength{"max":16}'
    }).addItem({
   	 	element: '[name=password_confirmation]',
   	 	required: true,
   	 	rule: 'confirmation{target: "#password"}'
    }).addItem({
    	element: '[name=nickname]',
   	 	required: true
    }).addItem({
    	element: '[name=email]',
   	 	required: true,
   	 	rule:"email"
    });
})